﻿using Abp.Domain.Entities;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using static SOEI.Solution.AppCoreConst;

namespace SOEI.Solution.DomainEntities.ContractManagement
{
    /// <summary> 买卖合同正文
    /// </summary>
    [Table("CLFWQ_MMHTZW")]
    public class ContractBody : Entity<string>
    {
        #region -------------------------------------------------实体属性---------------------------------------------- 

        /// <summary> 字段名称
        /// </summary>
        [Required]
        [StringLength(EntityLength.Length100)]
        [MaxLength(EntityLength.Length100)]
        [Column("ZDMC")]
        public string Key { get; set; }

        /// <summary> 字段值
        /// </summary>
        [StringLength(EntityLength.Length2000)]
        [MaxLength(EntityLength.Length2000)]
        [Column("ZDZ")]
        public string Value { get; set; }

        /// <summary> 合同登记号
        /// </summary>
        [Required]
        [StringLength(EntityLength.Length10)]
        [MaxLength(EntityLength.Length10)]
        [Column("HTDJH")]
        public string ContractSummaryId { get; set; }

        #endregion

        #region -------------------------------------------------用户定义---------------------------------------------- 
        /* 这里创建自己的代码 */

        /// <summary> 复合主键
        /// </summary>
        [NotMapped]
        public override string Id => $"{ContractSummaryId}-{Key}";


        #endregion

        #region -------------------------------------------------导航属性---------------------------------------------- 

        #endregion

    }
}
